import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/home',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/home.vue'),
                    meta: { title: '总览' }
                },
                {
                    path: '/addUser',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/addUser.vue'),
                    meta: { title: '添加用户' }
                },
                {
                    path: '/allcargo',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/allCargo.vue'),
                    meta: { title: '所有货物类型' }
                },
                {
                    path: '/tabs',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/page/Tabs.vue'),
                    meta: { title: '用户' }
                },
                {
                    path: '/cargo',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/addCargo.vue'),
                    meta: { title: '添加货物类型' }
                },
                {
                    // 添加标签
                    path: '/tags',
                    component: () => import(/* webpackChunkName: "editor" */ '../components/page/addTags.vue'),
                    meta: { title: '添加标签' }
                },
                {
                    // 展示标签
                    path: '/showtags',
                    component: () => import(/* webpackChunkName: "markdown" */ '../components/page/allTags.vue'),
                    meta: { title: '全部标签' }
                },
                {
                    // 图片上传组件
                    path: '/allcustomer',
                    component: () => import(/* webpackChunkName: "upload" */ '../components/page/allCustomer.vue'),
                    meta: { title: '全部客户' }
                },
                {
                    // vue-schart组件
                    path: '/addcustomer',
                    component: () => import(/* webpackChunkName: "chart" */ '../components/page/addCustomer.vue'),
                    meta: { title: '添加客户' }
                },
                {
                    // 拖拽列表组件
                    path: '/consignmentlist',
                    component: () => import(/* webpackChunkName: "drag" */ '../components/page/allSign.vue'),
                    meta: { title: '全部运单' }
                },
                {
                    // 拖拽Dialog组件
                    path: '/addsign',
                    component: () => import(/* webpackChunkName: "dragdialog" */ '../components/page/addSign.vue'),
                    meta: { title: '添加运单' }
                },
                {
                    // 国际化组件
                    path: '/alldet',
                    component: () => import(/* webpackChunkName: "i18n" */ '../components/page/allDet.vue'),
                    meta: { title: '运单详情' }
                },
                {
                    // 权限页面
                    path: '/phy',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/phy.vue'),
                    meta: { title: '物流分析'}
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                },
                {
                    path: '/temp',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/temp.vue'),
                    meta: { title: '温度数据' }
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        },
        {
            path: '/reg',
            component: () => import(/* webpackChunkName: "reg" */ '../components/page/Reg.vue'),
            meta: { title: '注册' }
        },
        {
            path: '/nopassword',
            component: () => import(/* webpackChunkName: "reg" */ '../components/page/nopassword.vue'),
            meta: { title: '忘记密码' }
        },
        {
            path: '/changepassword',
            component: () => import(/* webpackChunkName: "reg" */ '../components/page/changepassword.vue'),
            meta: { title: '修改密码' }
        },
        {
            path: '/test',
            component: () => import(/* webpackChunkName: "reg" */ '../components/page/test.vue'),
            meta: { title: 'test' }
        },
    ],//changepassword
    mode:'history'   /*hash*/ /*不显示路由中的#*/  
});
